<template>

  <a-modal
    :title="title"
    :width="1000"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
	:maskClosable="false"
    cancelText="关闭"
  class="btn_none">

  <a-card :bordered="false">
    
    <div>
      <a-steps :current="-1" direction="vertical">
        <a-step title="开始" />
        <a-step :title="flowNode.name" v-for="flowNode in flowNodeList"/>
        <a-step title="结束" />
      </a-steps>

    </div>

  </a-card>

  </a-modal>
</template>

<script>
  /*import ModelModal from './modules/ModelModal'*/
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction,deleteAction,putAction,postAction} from '@/api/manage'

  export default {
    name: "MainProcessHistoryList",
    mixins:[JeecgListMixin],
    components: {
      /*ModelModal,*/
      /*ModelEditModal*/
    },
    data () {
      return {
        description: '历史审核页面',
        paramId:"",
        title:"操作",
        visible: false,
        confirmLoading: false,
        imageUrl: '',
        flowNodeList: {},
        
		url: {
          list: "/act/taskinst/history/task/"+this.paramId,
          getMainProcess: "/handle/getMainProcess"
       },
        addModel:true,
        modelSrc:'',
    }
  },
  computed: {
    /*importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }*/
  },
    methods: {

      init (id) {
        this.visible = true;
        this.paramId = id;

        getAction(this.url.getMainProcess, {businessKey:id}).then((res) => {
          if (res.success) {
            this.flowNodeList = res.result
          }
        })

      },
      getRandomInt(min, max) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
      },

      handleCancel () {
        this.close()
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      loadList() {
        //var params = this.getQueryParams();//查询条件
        this.loading = true;
        getAction("/act/taskinst/history/task/"+this.paramId, {}).then((res) => {
          if (res.success) {
            this.dataSource = res.result;
            //this.ipagination.total = res.result.total;
          }
          if(res.code===510){
            this.$message.warning(res.message)
          }
          this.loading = false;
        })
      },
      getYMDHMS(dateInterval) {
        //计算出相差天数
        var days = Math.floor(dateInterval / (24 * 60 * 60 * 1000));
        //计算小时数
        var hourLevel = dateInterval % (24 * 60 * 60 * 1000);
        var hours = Math.floor(hourLevel / (60 * 60 * 1000))
        //计算分钟数
        var minutesLevel = hourLevel % (60 * 60 * 1000);
        var minutes = Math.floor(minutesLevel / (60 * 1000));
        //计算秒数
        var seconds = Math.round((minutesLevel % (60 * 1000)) / 1000);
        return '天数 ' + days + ' 小时数 ' + hours + ' 分钟数 ' + minutes + ' 秒数 ' + seconds;
      }
      /*editModel(row){
        /!*this.modelSrc=window._CONFIG['domianURL']+'/modeler.html?modelId='+row.id;
        this.addModel=true;*!/
        let url =window._CONFIG['domianURL']+'/modeler.html?modelId='+row.id;
        window.open(url);
      },
      deployModel(row){
        const that = this;

        this.$confirm({
          title: "提示",
          content: "请确认点击了左上角的保存按钮?",
          onOk: function () {
            that.loading = true;
            getAction("/act/model/deploy/",{id:row.id}).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
              }else{
                that.$message.warning(res.message)
              }
            });
          }
        });


      },*/


    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
<style lang="less">
  .btn_none{
    .ant-modal-footer{
      display: none;
    }
  }
</style>